<template>
  <div class="air">
    <el-row :gutter="20">
        <el-col :span="24" class="paddCol" >
            <el-card class="box-card">
              <div slot="header" class="clearfix">
                  <span :style="this.alarmstate == 0 ? '':'color:#ea2e2e'"><i class="el-icon-menu"></i> <span class="shebeiname">{{this.data.name}}</span></span>
              </div>
              <div class="temp_card">
                <div class="xtg402_data">
                  <div class="mouse_data">
                      <el-row :gutter="20" class="paddCol">
                        <el-col :span="6" class="paddCol">
                          <el-card class="box-card">
                            <div class="mouse_left">
                              <div class="mouse_left_data mouse_left_data_top">
                                <svg class="icon" aria-hidden="true" v-if="this.data.unit[35].value == 1">
                                  <use xlink:href="#icon-shengyin" />
                                </svg>
                                <svg class="icon" aria-hidden="true">
                                  <use xlink:href="#icon-shengyinguan"  v-if="this.data.unit[35].value == 0"/>
                                </svg>
                                <div class="mouse_shengyin">通道一</div>
                                <el-row :gutter="24" class="mouse_sy_div">
                                  <el-col :span="5">
                                    <p>&nbsp;</p>
                                  </el-col>
                                  <el-col :span="14" class="mouse_sy_data">{{parseFloat(this.data.unit[0].value).toFixed(1)}}</el-col>
                                  <el-col :span="5" class="mouse_sy_flag">{{this.data.unit[0].flag}}</el-col>
                                </el-row>
                              </div>
                              <p class="mouse_yuan_line"></p>
                              <div class="mouse_left_data">
                                <svg class="icon" aria-hidden="true" v-if="this.data.unit[36].value == 1">
                                  <use xlink:href="#icon-shengyin" />
                                </svg>
                                <svg class="icon" aria-hidden="true">
                                  <use xlink:href="#icon-shengyinguan"  v-if="this.data.unit[36].value == 0"/>
                                </svg>
                                <div class="mouse_shengyin">通道二</div>
                                <el-row :gutter="24" class="mouse_sy_div">
                                  <el-col :span="5">
                                    <p>&nbsp;</p>
                                  </el-col>
                                  <el-col :span="14" class="mouse_sy_data">{{parseFloat(this.data.unit[2].value).toFixed(1)}}</el-col>
                                  <el-col :span="5" class="mouse_sy_flag">{{this.data.unit[2].flag}}</el-col>
                                </el-row>
                              </div>
                            </div>
                          </el-card>
                        </el-col>
                        <el-col :span="12" class="paddCol">
                          <el-card class="box-card">
                            <div class="mouse_loushuibk">
                              <div class="loushui_div">
                                <div class="loushui_title">
                                  <div class="loushui_title_icon">
                                    <svg class="icon" aria-hidden="true">
                                          <use xlink:href="#icon-warter_5" />
                                    </svg>
                                  </div>
                                  <div class="loushui_title_wenzi">水浸监测</div>
                                  <div class="loushui_title_num">1</div>
                                </div>
                                <div class="loushui_zheng" v-if="this.data.unit[51].value == 0"></div>
                                <p class="loushui_zheng_zi" v-if="this.data.unit[51].value == 0">正常</p>
                                <div class="loushui_warning" v-if="this.data.unit[51].value == 1"></div>
                                <p class="loushui_warning_zi" v-if="this.data.unit[51].value == 1">告警</p>
                              </div>
                              <div class="loushui_center"></div>
                              <div class="loushui_div">
                                <div class="loushui_title">
                                  <div class="loushui_title_num">2</div>
                                  <div class="loushui_title_wenzi">水浸监测</div>
                                  <div class="loushui_title_icon">
                                    <svg class="icon" aria-hidden="true">
                                          <use xlink:href="#icon-warter_5" />
                                    </svg>
                                  </div>
                                </div>
                                <div class="loushui_zheng loushui_zheng_right" v-if="this.data.unit[52].value == 0"></div>
                                <p class="loushui_zheng_zi loushui_zheng_zi_right" v-if="this.data.unit[52].value == 0">正常</p>
                                <div class="loushui_warning loushui_zheng_right" v-if="this.data.unit[52].value == 1"></div>
                                <p class="loushui_warning_zi loushui_zheng_zi_right" v-if="this.data.unit[52].value == 1">告警</p>
                              </div>
                            </div>
                              
                              <div class="shijian" style="display:none">
                                {{this.data.unit[17].value}}<span class="timeG">-</span>{{this.data.unit[18].value}}<span class="timeG">-</span>{{this.data.unit[19].value}}
                                &ensp;{{this.data.unit[20].value}}<span style="margin:0px 3px">:</span>{{this.data.unit[21].value}} 
                              </div>
                          </el-card>
                        </el-col>
                        <el-col :span="6" class="paddCol">
                          <el-card class="box-card">
                            <div class="mouse_left">
                              <div class="mouse_left_data mouse_left_data_top">
                                <svg class="icon" aria-hidden="true" v-if="this.data.unit[37].value == 1">
                                  <use xlink:href="#icon-shengyin" />
                                </svg>
                                <svg class="icon" aria-hidden="true">
                                  <use xlink:href="#icon-shengyinguan"  v-if="this.data.unit[37].value == 0"/>
                                </svg>
                                <div class="mouse_shengyin">通道三</div>
                                <el-row :gutter="24" class="mouse_sy_div">
                                  <el-col :span="5">
                                    <p>&nbsp;</p>
                                  </el-col>
                                  <el-col :span="14" class="mouse_sy_data">{{parseFloat(this.data.unit[4].value).toFixed(1)}}</el-col>
                                  <el-col :span="5" class="mouse_sy_flag">{{this.data.unit[4].flag}}</el-col>
                                </el-row>
                              </div>
                              <p class="mouse_yuan_line"></p>
                              <div class="mouse_left_data">
                                <svg class="icon" aria-hidden="true" v-if="this.data.unit[38].value == 1">
                                  <use xlink:href="#icon-shengyin" />
                                </svg>
                                <svg class="icon" aria-hidden="true">
                                  <use xlink:href="#icon-shengyinguan"  v-if="this.data.unit[38].value == 0"/>
                                </svg>
                                <div class="mouse_shengyin">通道四</div>
                                <el-row :gutter="24" class="mouse_sy_div">
                                  <el-col :span="5">
                                    <p>&nbsp;</p>
                                  </el-col>
                                  <el-col :span="14" class="mouse_sy_data">{{parseFloat(this.data.unit[6].value).toFixed(1)}}</el-col>
                                  <el-col :span="5" class="mouse_sy_flag">{{this.data.unit[6].flag}}</el-col>
                                </el-row>
                              </div>
                            </div>
                          </el-card>
                        </el-col>
                      </el-row> 
                      <div class="kongzhi">
                        <div :class="this.open == 0 ?'control':'control kzButton1'" @click="switchOpen(33)">
                          <svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-guanji"></use>
                          </svg>
                          <span v-if="this.open == 1">开机</span>
                          <span v-if="this.open == 0">关机</span>
                        </div>
                        <div class="control" @click="switchOpen(30)">
                          <div v-if="this.changjing == 0">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-branch" />
                            </svg>
                            四向
                          </div>
                          <div class="jiaoti_but" v-if="this.changjing == 1">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-xunhuan1" />
                            </svg>
                            <span>
                            交替
                            </span>
                          </div>
                          <div v-if="this.changjing == 2">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-xunhuan12" />
                            </svg>
                            循环
                          </div>
                        </div>
                        <div class="control" @click="switchOpen(29)">
                          <div v-if="this.moshi == 0">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-ziyuan" />
                            </svg>
                            高频
                          </div>
                          <div class="lisan_but"  v-if="this.moshi == 1">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-shengboyuyinxiaoxi" />
                            </svg>
                            <span>离散</span>
                          </div>
                          <div v-if="this.moshi == 2">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-gengduo" />
                            </svg>
                            低频
                          </div>
                        </div>
                        <div :class="this.open == 1 && this.timing == 1?'control kzButton1':'control'" @click="switchOpen(32)">
                          <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-dingshiguanbi" />
                          </svg>
                          定时
                        </div>
                        <div :class="this.noise == 1?'control kzButton1':'control'" @click="switchOpen(28)">
                          <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-shengyinguan" />
                          </svg>
                          消音
                        </div>
                      </div>
                  </div>
                  <div class="temp_time_mode">
                    <div class="temp_peak_name">
                      <i class="el-icon-time"></i>
                      时间统计
                    </div>
                    <div class="temp_time">
                      <div class="temp_time_line">
                        <p class="temp_warning_title">首次上线：</p>
                        <p class="temp_time_year">{{ this.firstconnecttimeYear }} </p> 
                        <p class="temp_time_hour">{{ this.firstconnecttimeHour}}</p>
                      </div>
                      <div class="temp_time_line" v-if="this.connecttime > 0">
                        <p class="temp_warning_title">最近上线：</p>
                        <p class="temp_time_year">{{ this.connecttimeYear }} </p>
                        <p class="temp_time_hour">{{ this.connecttimeHour }}</p>
                      </div>
                      <div class="temp_time_line" v-if="this.devtimeshow == 1">
                        <p class="temp_warning_title">累计时长：</p>
                        <p class="temp_time_h"> {{this.totaltime}} </p> <span class="temp_time_s"> h</span>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </el-card>
        </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props: ["msg"],
  data() {
    return {
      alarmstate:0,//在线离线
      timeGetData:'',//接口方法的定时器
      data: "", //当前设备数据
      dataor:1,//判断接口是否成功，1表示有返回成功，0表示失败，3之内无返回就置0表示失败
      // 控制项
      openNum:0,//当前点击键值计时
      openGetData:'',//当前点击键值定时器
      open:0,//开关机
      changjing:0,//场景
      moshi:0,//模式
      noise:0,//消音
      timing:0,//定时
      //属性数据
      firstconnecttimeYear:'',//首次上线年月日
      firstconnecttimeHour:'',//首次上线时分
      connecttime:0,//最近上线时间戳
      connecttimeYear:'',//最近上线年月日
      connecttimeHour:'',//最近上线时分
      totaltime:0,//累计运行时间
      devtimeshow:localStorage.getItem('累计时长'),//累计运行时间显示隐藏
      localname:'',//本地储存名称
    };
  },
  mounted() {
  },
  created() {
     // 判断是否是直接访问当前设备页面
    if(localStorage.getItem('当前访问路径') == 'overview2'){
      this.localname = "6.0展示设备卡片"
    }else{
      this.localname = "当前设备编号"
    }
    this.info = JSON.parse(localStorage.getItem(this.localname))
    this.data = JSON.parse(localStorage.getItem("menuDataJson"))
    this.getData(JSON.parse(localStorage.getItem(this.localname)))
    this.getDataStart()
  },
  methods: {
    //重新定时走接口
    getDataStart(){
      this.$nextTick(() => {
          this.timeGetData = setInterval(() => {
            if(this.dataor == 0){ //接口失败提示
              this.$message({
                message: '服务器访问失败',
                type: 'error',
                duration: 1000
              });
            }
            this.getData(JSON.parse(localStorage.getItem(this.localname)))
            this.dataor = 0
          }, 3000); 
      })
    },
    getData(info){
      this.info = info
      if(info.uid == null || info.uid == "null"){//清空缓存第一次进入时找不到info.uid，页面为空页面的处理
        info.uid = 0
      }
      var params = {
          "getdevinfo":[
            {
              "uid": info.uid,
              "type": info.type,
              "addr": info.addr,
              "unittype":"id-name-ready-value-flag-max-min"
            }
          ],
          [localStorage.getItem("cookieName")]:localStorage.getItem("_token")
      }
      this.$http.post(this.$baseUrl, params).then((res) => {
        this.dataor = 1// 接口成功置1
        if(res.data.getdevinfo == undefined){ //数据返回不全失败提示
          this.$message({
            message: '服务器访问失败',
            type: 'error',
            duration: 1000
          });
        }else{
          this.data = res.data.getdevinfo[0];
          this.alarmstate = res.data.getdevinfo[0].alarmstate
          console.log(info.uid)
          // 上次上线时间
          this.firstconnecttimeYear = this.formatDate(this.data.firstconnecttime*1000, 'YYYY-MM-DD')
          this.firstconnecttimeHour = this.formatDate(this.data.firstconnecttime*1000, 'H:m')
          // 最近上线时间
          this.connecttime = this.data.connecttime
          this.connecttimeYear = this.formatDate(this.data.connecttime*1000, 'YYYY-MM-DD')
          this.connecttimeHour = this.formatDate(this.data.connecttime*1000, 'H:m')
          //累计运行时间 拿到的分钟转成小时
          this.devtimeshow = localStorage.getItem('累计时长')
          this.totaltime = (this.data.totaltime/60).toFixed(0)
          if(this.openNum == 0){//不处于计时状态，正常读取真实状态
            this.open = this.data.unit[33].value
            this.changjing = this.data.unit[30].value
            this.moshi = this.data.unit[29].value
            this.noise = this.data.unit[28].value
            this.timing = this.data.unit[32].value
          }
        }
      })
    },
    switchOpen(id){
        var st = 0;
        if(id == 33){ //开关机
          if(this.open == 0){
            st = 1
          }else if(this.open == 1){
            st = 0
          }else{
            return false;
          }
          this.open = st
        }else{
          if(this.open == 1){
            if(id == 30){ //场景
              if(this.changjing == 0){
                st = 1
              }else if(this.changjing == 1){
                st = 2
              }else if(this.changjing == 2){
                st = 0
              }else{
                return false;
              }
              this.changjing = st
            }else if(id == 29){//模式
              if(this.moshi == 0){
                st = 1
              }else if(this.moshi == 1){
                st = 2
              }else if(this.moshi == 2){
                st = 0
              }else{
                return false;
              }
              this.moshi = st
            }else if(id == 32){//定时
              if(this.timing == 0){
                st = 1
              }else if(this.timing == 1){
                st = 0
              }else{
                return false;
              }
              this.timing = st
            }else if(id == 28){//消音
              if(this.noise == 0){
                st = 1
              }else if(this.noise == 1){
                st = 0
              }else{
                return false;
              }
              this.noise = st
            }
          }else{
            this.$message({
              message: '设备未开机',
              type: 'error',
              duration: 1000
            });
            return false;
          }
        }
      var params = {
          "setdevinfo":[
              {
                  "uid": this.info.uid,
                  "type": this.info.type,
                  "addr": this.info.addr,
                  "unit":[
                    {
                      id: id,
                      value: st
                    }
                  ]
              }
          ],
          [localStorage.getItem("cookieName")]:localStorage.getItem("_token")
      }
      this.openNum = 0
      clearInterval(this.openGetData);
      this.openGetData = null;
      this.openGetData = setInterval(() => { //开关机、模式、净化模式、风速同时判断，都一致表示刚刚下发成功（可能会有在设备上操作导致十防上判断到不一致触发此方法导致的延迟事件，最多延迟10秒）
        if((this.data.unit[33].value != this.open || this.data.unit[30].value != this.changjing ||this.data.unit[32].value != this.timing ||this.data.unit[29].value != this.moshi ||this.data.unit[28].value != this.noise) && (this.openNum <= 5)){
            this.openNum++
        }else{//超过10秒返回的值和当前的值不一样 或者已读到当前状态修改成功，就结束循环读取真实状态
          this.open = this.data.unit[33].value
            this.changjing = this.data.unit[30].value
            this.moshi = this.data.unit[29].value
            this.noise = this.data.unit[28].value
            this.timing = this.data.unit[32].value
          this.openNum = 0
          clearInterval(this.openGetData);
          this.openGetData = null;
        }
      }, 1000); 
      this.$http.post(this.$baseUrl, params).then((res) => {
          if(res.data.result == 'ok'){
              
          }else{
              this.$notify({
                  title: '操作失败',
                  type: 'warning',
                  duration: 1500
              });
          }
      });
    }
  },
  // 清除定时器
    beforeDestroy() {
        clearInterval(this.timeGetData);
        this.timeGetData = null;
    },
};
</script>

<style scoped>
.el-card {
  background: none;
  color: #fff;
  border: 1px solid rgba(89, 129, 165, 0.4);
}
/deep/ .el-card__header {
  background: rgba(89, 129, 165, 0.2);
  padding: 16px 20px;
  border-bottom: none;
}
.box-card {
  /* overflow: hidden; */
}
.temp_card{
  height: 850px;
}
.clearfix{
  font-size: 18px;
}
.shebeiname{
  font-weight: bold;
}
.xtg402_data{
  display: flex;
}
.mouse_data{
  width: 970px;
  height: 524px;
  margin-top: 98px;
  /* padding-right: 30px; */
  /* background: #0000002b; */
  border: 1px solid #5981a566;
  box-shadow: 0px 0px 12px #b4e9ff73;
  border-radius: 10px;
}
.mouse_water{
  width: 100%;
  height: 170px;
  display: flex;
}
.mouse_waterl{
  width: 50%;
  height: 170px;
  display: flex;
  align-items: self-end;
  justify-content: center;
}
.mouse_waterl .icon{
  font-size: 100px;
}
.mouse_waterl p{
  font-size: 34px;
  position: relative;
  top: -5px;
}
.set_humi{
  background: #43607b7a;
  color: #fff;
  font-size: 22px;
  margin-bottom: 40px;
  
  padding: 20px 35px;
}
.set_humi:hover{
  background: #43607b;
}
.mouse_set{
  width: 100%;
  margin-top: 100px;
}
.mouse_open{
  width: 100%;
  text-align: center;
}
.mouse_set_flex{
  width: 70%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  margin-top: 40px;
}
.mouse_set_flex .set_humi{
  margin: 0 30px;
}

/* 在线时间 */
.temp_time_mode{
  width: 400px;
  height: 540px;
  /* margin: 0 auto; */
  padding-top: 30px;
  border-radius: 10px;
  background: #0000002b;
  margin-bottom: 20px;
  margin-top: 90px;
  margin-left: 50px;
}
.temp_peak_name{
  width: 100%;
  font-size: 22px;
  margin-left: 20px;
}
.temp_time{
  margin-top: 80px;
  margin-left: 25px;
  height: 310px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.temp_time_line{
  margin-bottom: 90px;
  position: relative;
  top: 11px;
  display: flex;
  font-size: 20px;
}
.temp_time{
  margin-right: 30px;
  color: #d4d3d3;
}
.temp_time .temp_warning_title{
  width: 110px;
}
.temp_time_year{
  width: 150px;
  font-family: electronicFont;
  font-size: 28px;
  color: #5eceff;
}
.temp_time_hour{
  width: 40px;
  font-family: electronicFont;
  font-size: 28px;
  color: #5eceff;
}
.temp_time_h{
  font-family: electronicFont;
  font-size: 35px;
  color: #5eceff;
  position: relative;
  top: -5px;
}
.temp_time_s{
  color: #5eceff;
  margin-left: 5px;
}
/* 驱鼠器界面 */
.paddCol{
  padding: 0px !important;
  margin: 0px !important;
}
/* 左侧 */
.mouse_left_data{
  height: 190px;
  padding: 20px 10px;
}
.mouse_left_data_top{
  padding-top: 0px;
}
.mouse_left_data .icon{
  font-size: 35px;
}
.mouse_shengyin{
  float: right;
  font-size: 20px;
  letter-spacing: 4px;
}
.mouse_left .mouse_yuan_line{
  width: 170px;
}
.mouse_sy_div{
  margin-top: 45px;
}
.mouse_sy_div_bottom{
  margin-top: 35px;
}
.mouse_sy_data{
  text-align: center;
  font-size: 40px;
  color: #18ffff;
}
.mouse_sy_flag{
  font-size: 20px;
  margin-top: 17px;
}
.mouse_yuan_line{
  width: 320px;
  height: 1px;
  margin: 0 auto;
  background: #5981a566;
}
/* 中间 */
.shijian{
  float: left;
  position: relative;
  top: 2px;
  width: 50%;
}
.timeG{
  position: relative;
  top: -3px;
  margin: 0px 5px;
}
.set_m{
  float: right;
  width: 50%;
  text-align: right;
  height: 10px;
  font-size: 30px;
  cursor: pointer;
}
.mouse_yuan{
  width: 343px;
  height: 343px;
  margin: 0 auto;
  border-radius: 100%;
  border: 10px solid #4f7292;
}
.mouse_yuan_line{
  width: 320px;
  height: 1px;
  margin: 0 auto;
  background: #5981a566;
}
.mouse_yuan_div{
  height: 165px;
  text-align: center;
  margin: 0 auto;
  width: 326px;
  display: flex;
}
.mouse_yuan_div div{
  flex: 1;
}
.mouse_yuan_top{
  padding-top: 82px;
}
.mouse_yuan_bot{
  padding-top: 35px;
}
.mouse_yuan_s .icon{
  font-size: 30px;
}
.mouse_yuan_s .m_jiao{
  font-size: 52px;
  margin-top: -13px;
}
.mouse_yuan_s .m_lisan{
  font-size: 50px;
  margin-top: -10px;
}
.mouse_yuan_s .m_ks{
  font-size: 35px;
}
.mouse_yuan_l .icon{
  margin-top: -15px;
  font-size: 50px;
}
.mouse_yuan_l .m_ks{
  font-size: 60px;
}
.mouse_yuan_l .m_jiao{
  font-size: 90px;
  margin-top: -38px;
}
.mouse_yuan_l .m_lisan{
  font-size: 85px;
  margin-top: -25px;
}

.mouse_yuan_l p{
  color: #18ffff;
  margin-top: 7px;
  font-size: 18px;
}
.mouse_yuan_l .m_jiao_p{
  position: relative;
  top: -18px;
}
.mouse_yuan_l .m_ks_p{
  margin-top: 27px;
}
.mouse_loushui{
  height: 20px;
}
.mouse_loushui .icon{
  font-size: 30px;
}
/*  */
/deep/ .el-dialog__header .el-dialog__title{
  color: #Fff !important;
}
/deep/ .el-dialog__body{
  color: #fff;
  padding-top: 5px;
}
/deep/ .el-form-item__label{
  color: #fff;
}
/deep/ .el-input__inner{
    background: rgba(255, 255, 255, 0);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 5px;
}
.gasfilter_img{
  text-align: center;
  margin: 10px 0px;
}
.gasfilter_img img{
  height:454px;
}
/* 底部按钮样式设置 */
.kongzhi{
  display: flex;
}
.control{
  height: 100px;
  flex: 1;
  border:1px solid rgba(89, 129, 165, 0.6) !important;
  line-height: 100px;
  text-align: center;
  font-size: 26px;
  cursor: pointer;
}
.kongzhi .control:first-child{
  border-bottom-left-radius: 10px;
}
.kongzhi .control:last-child{
  border-bottom-right-radius: 10px;
}
.kzButton1{
  background:rgba(89, 129, 165, 0.6) !important;
  border:1px solid rgba(89, 129, 165, 0.6) !important;
}
.dingshi{
  font-size: 35px;
  position: relative;
  top: 4px;
}
.shoudong{
  font-size: 35px;
  position: relative;
  top: 3px;
}
/* 底部按钮图标样式 */
.jiaoti_but .icon,.lisan_but .icon{
  font-size: 37px;
  position: relative;
  top: 3px;
}
.jiaoti_but span,.lisan_but span{
  position: relative;
  left: -5px;
}

/* 漏水样式 */
.mouse_loushuibk {
  display: flex;
  align-items: center;
}
.loushui_div{
  width: 50%;
  height: 381px;
}
.loushui_center{
  width: 2px;
  height: 330px;
  background: #7c8ea4;
}
.loushui_title{
  display: flex;
}
.loushui_title_icon{
  font-size: 35px;
  text-align: center;
  width: 20%;
}
.loushui_title_wenzi{
  font-size: 25px;
  line-height: 45px;
  padding-left: 5px;
  width: 50%;
}
.loushui_title_num{
  font-size: 35px;
  line-height: 46px;
  text-align: center;
  width: 30%;
}
/* 漏水未报警的动画样式 */
.loushui_zheng{
  width: 80%;
  height: 60%;
  margin-top: 30px;
  margin-left: 20px;
  animation: move 3s linear  infinite; /*自定义动画名称*/
  /*!move：动画名称，10s：执行时间 
     ease：执行的函数，infinite：代表执行次数，这里指无限次*!*/
}
@keyframes move {
/**注意这几个图片大小一定要一样，否则会出现抖动现象*/
/*这里的0%50%100%是相对于执行时间的，最后一个图片先播放*/
  0%{
    background: url('../../assets/loushui3.png') no-repeat;
  	background-size:100% auto;
  	}
  25%{
    background: url('../../assets/loushui1.png') no-repeat;
  	background-size:100% auto;
  	}
  50%{
  	background: url('../../assets/loushui3.png') no-repeat;
  	background-size:100% auto; 
  	}
  75%{
  	background: url('../../assets/loushui2.png') no-repeat;
  	background-size:100% auto; 
  	}
  100%{
  	background: url('../../assets/loushui3.png') no-repeat;
  	background-size:100% auto; 
  	}
}
.loushui_zheng_zi{
  text-align: center;
  font-size: 28px;
  margin-right: 20px;
  margin-top: 20px;
}

.loushui_zheng_zi_right{
  margin-left: 40px;
}
/* 漏水报警动画样式 */
.loushui_warning{
  width: 80%;
  height: 60%;
  margin-top: 30px;
  margin-left: 15px;
  animation: move2 3s linear  infinite; /*自定义动画名称*/
  /*!move：动画名称，10s：执行时间 
     ease：执行的函数，infinite：代表执行次数，这里指无限次*!*/
}
@keyframes move2 {
/**注意这几个图片大小一定要一样，否则会出现抖动现象*/
/*这里的0%50%100%是相对于执行时间的，最后一个图片先播放*/
  0%{
    background: url('../../assets/gaojing2.png') no-repeat;
  	background-size:100% auto;
  	}
  50%{
    background: url('../../assets/gaojing.png') no-repeat;
  	background-size:100% auto;
  	}
  100%{
  	background: url('../../assets/gaojing2.png') no-repeat;
  	background-size:100% auto; 
  	}
}
.loushui_warning_zi{
  text-align: center;
  font-size: 28px;
  margin-right: 20px;
  margin-top: 20px;
  color: #bf0414;
  font-weight: bold;
}
.loushui_zheng_right{
  margin-left: 40px;
  /* 水平翻转 */
  -moz-transform:scaleX(-1); 
  -webkit-transform:scaleX(-1); 
  -o-transform:scaleX(-1); 
  transform:scaleX(-1); 
  /*IE*/ filter:FlipH;
}
</style>